COMPILER=gcc -g
C_PLUS=g++ -g
COMP=$(COMPILER) -o $@ -c
TARGET1=sim
LIBS=-lpthread
OBJS=Tokenizing.o Thread.o Semaphore.o Message.o BoundedMailBox.o SystemCalls.o Scheduler.o UnBoundedMailBox.o Shell.o Kernel.o Mailer.o Node.o RT.o
.SUFFIXES: no_suffiexes

project : $(TARGET1)

$(TARGET1): simulator.cpp $(OBJS)
	$(C_PLUS) -o $(TARGET1)  simulator.cpp  $(OBJS) $(LIBS) 
Thread.o: Thread.cpp Thread.h
	$(COMPILER) -D_REENTRANT -o Thread.o -c Thread.cpp
Tokenizing.o: Tokenizing.cpp Tokenizing.h
	$(C_PLUS) -D_REENTRANT -o Tokenizing.o -c Tokenizing.cpp
Scheduler.o:  Scheduler.h Scheduler.cpp
	$(C_PLUS) -D_REENTRANT -o Scheduler.o -c Scheduler.cpp
Semaphore.o: Semaphore.h Semaphore.cpp
	$(C_PLUS) -D_REENTRANT -o Semaphore.o -c Semaphore.cpp
Message.o: Message.h Message.cpp
	$(C_PLUS) -D_REENTRANT -o Message.o -c Message.cpp
BoundedMailBox.o: BoundedMailBox.h BoundedMailBox.cpp
	$(C_PLUS) -D_REENTRANT -o BoundedMailBox.o -c BoundedMailBox.cpp
SystemCalls.o: SystemCalls.h SystemCalls.cpp
	$(C_PLUS) -D_REENTRANT -o SystemCalls.o -c SystemCalls.cpp
UnBoundedMailBox.o: UnBoundedMailBox.h UnBoundedMailBox.cpp
	$(C_PLUS) -D_REENTRANT -o UnBoundedMailBox.o -c UnBoundedMailBox.cpp
Shell.o: Shell.h Shell.cpp
	$(C_PLUS) -D_REENTRANT -o Shell.o -c Shell.cpp
Kernel.o: Kernel.h Kernel.cpp
	$(C_PLUS) -D_REENTRANT -o Kernel.o -c Kernel.cpp
Mailer.o: Mailer.h Mailer.cpp
	$(C_PLUS) -D_REENTRANT -o Mailer.o -c Mailer.cpp
Node.o: Node.h Node.cpp
	$(C_PLUS) -D_REENTRANT -o Node.o -c Node.cpp
RT.o: RT.h RT.cpp
	$(C_PLUS) -D_REENTRANT -o RT.o -c RT.cpp

clean: 
	rm -f *.o
	rm sim